package org.csmzxy.class2333;

public class Work02 {
    public static void main(String[] args) {
        int[] arr = {1, 13, 2, 3, 8};
        for (int i = 0; i < arr.length - 1 ; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
            }
        }
    }
    System.out.println("排序后的数组：");
    for (int num : arr) {
        System.out.println(num +"");
    }
    System.out.println();
    int max = arr[arr.length-1];
    System.out.println("最大值：" + max);
    }
}
